package com.lqq.designPattern.bulider_pattern.factory.simpleFactory;

//咖啡店
public class CoffeeStore {
    //点咖啡
    public Coffee orderCoffee(String type) {
        //调用咖啡工厂生产具体咖啡，此时咖啡店和具体产品对象的依赖，解耦合
        SimpleCoffeeFactory factory = new SimpleCoffeeFactory();
        Coffee coffee = factory.createCoffee(type);
        //加糖加奶
        coffee.addMilk();
        coffee.addSugar();
        return coffee;
    }
}
